<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateBookTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateBookLabel_id}" for="id" />
                    <h:inputText id="id" value="#{bookController.selected.id}" title="#{bundle.CreateBookTitle_id}" required="true" requiredMessage="#{bundle.CreateBookRequiredMessage_id}"/>
                    <h:outputLabel value="#{bundle.CreateBookLabel_isbn}" for="isbn" />
                    <h:inputText id="isbn" value="#{bookController.selected.isbn}" title="#{bundle.CreateBookTitle_isbn}" required="true" requiredMessage="#{bundle.CreateBookRequiredMessage_isbn}"/>
                    <h:outputLabel value="#{bundle.CreateBookLabel_title}" for="title" />
                    <h:inputText id="title" value="#{bookController.selected.title}" title="#{bundle.CreateBookTitle_title}" required="true" requiredMessage="#{bundle.CreateBookRequiredMessage_title}"/>
                    <h:outputLabel value="#{bundle.CreateBookLabel_summary}" for="summary" />
                    <h:inputText id="summary" value="#{bookController.selected.summary}" title="#{bundle.CreateBookTitle_summary}" required="true" requiredMessage="#{bundle.CreateBookRequiredMessage_summary}"/>
                    <h:outputLabel value="#{bundle.CreateBookLabel_publicationDate}" for="publicationDate" />
                    <h:inputText id="publicationDate" value="#{bookController.selected.publicationDate}" title="#{bundle.CreateBookTitle_publicationDate}" required="true" requiredMessage="#{bundle.CreateBookRequiredMessage_publicationDate}"/>
                    <h:outputLabel value="#{bundle.CreateBookLabel_bitmapURL}" for="bitmapURL" />
                    <h:inputText id="bitmapURL" value="#{bookController.selected.bitmapURL}" title="#{bundle.CreateBookTitle_bitmapURL}" />
                    <h:outputLabel value="#{bundle.CreateBookLabel_price}" for="price" />
                    <h:inputText id="price" value="#{bookController.selected.price}" title="#{bundle.CreateBookTitle_price}" required="true" requiredMessage="#{bundle.CreateBookRequiredMessage_price}"/>
                    <h:outputLabel value="#{bundle.CreateBookLabel_stock}" for="stock" />
                    <h:inputText id="stock" value="#{bookController.selected.stock}" title="#{bundle.CreateBookTitle_stock}" required="true" requiredMessage="#{bundle.CreateBookRequiredMessage_stock}"/>
                    <h:outputLabel value="#{bundle.CreateBookLabel_createdDate}" for="createdDate" />
                    <h:inputText id="createdDate" value="#{bookController.selected.createdDate}" title="#{bundle.CreateBookTitle_createdDate}" required="true" requiredMessage="#{bundle.CreateBookRequiredMessage_createdDate}">
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.CreateBookLabel_updatedDate}" for="updatedDate" />
                    <h:inputText id="updatedDate" value="#{bookController.selected.updatedDate}" title="#{bundle.CreateBookTitle_updatedDate}" >
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.CreateBookLabel_deletedDate}" for="deletedDate" />
                    <h:inputText id="deletedDate" value="#{bookController.selected.deletedDate}" title="#{bundle.CreateBookTitle_deletedDate}" >
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.CreateBookLabel_seriesid}" for="seriesid" />
                    <h:selectOneMenu id="seriesid" value="#{bookController.selected.seriesid}" title="#{bundle.CreateBookTitle_seriesid}" >
                        <f:selectItems value="#{serieController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.CreateBookLabel_categoryid}" for="categoryid" />
                    <h:selectOneMenu id="categoryid" value="#{bookController.selected.categoryid}" title="#{bundle.CreateBookTitle_categoryid}" >
                        <f:selectItems value="#{categoryController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{bookController.create}" value="#{bundle.CreateBookSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{bookController.prepareList}" value="#{bundle.CreateBookShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:link outcome="/admin/admin.xhtml" value="#{bundle.CreateBookIndexLink}"/>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
